// 对象数组柱状图处理
export const viewObjectArrayHistogram = data => {
  let source = []
  let series = []
  data[0].map((item, index) => {
    source[index] = [item.name, item.data]
  })
  data.map((item, index) => {
    if (index === 0) {
      data[index].map((item2, index2) => {
        source[index2] = [item2.name, item2.data]
      })
    } else {
      data[index].map((item2, index2) => {
        source[index2].push(item2.data)
      })
    }
  })
  let nodeLength = 1
  for (let index = 0; index < nodeLength; index++) {
    series.push({
      type: 'bar',
      animationDelay: function (idx) {
        return idx * 10
      }
    })
  }
  source.unshift(['能源单位', '死能源A'])
  this.viewData = {
    series: series,
    source: source
  }
}
